#include <iostream>
#include <algorithm>
#include <ctime>
#include <cstdlib>

int const up = 1000;

int main()
{
	std::srand(std::time(0));
	int n = 60, m = 20;
	int t = 5;
	std::cout << t << '\n';
	while (t--) {
		std::cout << n << ' ' << m << '\n';
		for (int i = 0; i < n; i++) std::cout << rand() % up << ' ';
		std::cout << '\n';
		for (int i = 0; i < m; i++) {
			int l = rand() % n + 1, r = rand() % n + 1;
			if (l > r) std::swap(l, r);
			int a = rand() % up - up / 2, b = rand() % up + 1;
			std::cout << l << ' ' << r << ' ' << a << ' ' << b << '\n';
		}
	}
}

